
#ifndef _INPREADER_H__
#define _INPREADER_H__


#include <vtkSmartPointer.h>
#include <vtkUnstructuredGrid.h>
#include <vtkPoints.h>
#include <vtkCellArray.h>
#include <vtkTetra.h>
#include <vtkHexahedron.h>
#include <vtkXMLUnstructuredGridWriter.h>

#include <TopoDS_Shape.hxx>
#include <TopoDS_Compound.hxx>
#include <BRep_Builder.hxx>
#include <BRepBuilderAPI_MakeVertex.hxx>
#include <BRepBuilderAPI_MakePolygon.hxx>
#include <BRepBuilderAPI_MakeFace.hxx>
#include <BRepBuilderAPI_MakeShell.hxx>
#include <BRepBuilderAPI_MakeSolid.hxx>
#include <gp_Pnt.hxx>
#include <BRepBuilderAPI_MakeEdge.hxx>


#include <fstream>
#include <iostream>
#include <string>
#include <vector>
#include <map>

using namespace std;
#include "DataExchangeAPI.hpp"


NAMESPACE_BEGIN(NSInpReader)


class EXCHANGEAPI InpReader {
public:
    InpReader(const std::string& filename) : filename_(filename) {}
    TopoDS_Shape Read();

private:
    void ReadNodes(QTextStream& in, std::vector<gp_Pnt>& nodes);
    void ReadElements(QTextStream& in, std::vector<std::vector<int>>& elements);
    TopoDS_Shape CreateShapeFromData(const std::vector<gp_Pnt>& nodes, const std::vector<std::vector<int>>& elements);

    std::string filename_;
};


NAMESPACE_END


#endif // !_INPREADER_H__






